package p270jp.pxv.android.legacy.model;

import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import p325m0.MutabilityOwnership;

/* compiled from: NetworkDetector.kt */
/* renamed from: jp.pxv.android.legacy.model.NetworkDetector */
/* loaded from: classes2.dex */
public final class NetworkDetector {
    private final ConnectivityManager connectivityManager;

    public NetworkDetector(ConnectivityManager connectivityManager) {
        MutabilityOwnership.m3745m(connectivityManager, "connectivityManager");
        this.connectivityManager = connectivityManager;
    }

    public final String getNetWorkStateName() {
        NetworkInfo activeNetworkInfo = this.connectivityManager.getActiveNetworkInfo();
        if (activeNetworkInfo == null || activeNetworkInfo.getTypeName() == null) {
            return "NONE";
        }
        String subtypeName = activeNetworkInfo.getSubtypeName();
        if (subtypeName == null || subtypeName.length() == 0) {
            String typeName = activeNetworkInfo.getTypeName();
            MutabilityOwnership.m3746l(typeName, "{\n            activeNetworkInfo.typeName\n        }");
            return typeName;
        }
        return activeNetworkInfo.getTypeName() + '_' + ((Object) subtypeName);
    }
}
